package org.quipu.client;

import com.google.gwt.user.client.rpc.RemoteService;
import com.google.gwt.user.client.rpc.RemoteServiceRelativePath;
import java.util.Date;
import java.util.List;
import java.util.Map;
import org.quipu.AppException;
import org.quipu.dto.AccountDetailDto;
import org.quipu.dto.AccountDto;
import org.quipu.dto.BookCacheDto;
import org.quipu.dto.BookDto;
import org.quipu.dto.BookUserDto;
import org.quipu.dto.CategoryDto;
import org.quipu.dto.CurrencyDto;
import org.quipu.dto.TagDto;
import org.quipu.dto.TransactionDto;
import org.quipu.dto.TransactionsFilterDto;
import org.quipu.dto.UserDto;

/**
 * The client side stub for the RPC service.
 */
@RemoteServiceRelativePath("ui")
public interface MainService extends RemoteService {

    public UserDto getSessionUser();
    public void setSessionUser(UserDto user);
    public List<BookDto> getBooks() throws AppException;
    public BookCacheDto getBookCache(Long bookId, Long userId) throws AppException;
    public BookUserDto getBookUser(Long bookId) throws AppException;
    public List<AccountDetailDto> getBookAccountsCalculation(Long bookId, Date date, boolean approvedOnly) throws AppException;
    public List<AccountDto> getBookAccounts(Long bookId) throws AppException;
    public List<CurrencyDto> getBookCurrencies(Long bookId) throws AppException;
    public List<TagDto> getBookTags(Long bookId) throws AppException;
    public List<CategoryDto> getBookInCategories(Long bookId) throws AppException;
    public List<CategoryDto> getBookOutCategories(Long bookId) throws AppException;
    public List<TransactionDto> getBookTransactions(Long bookId, TransactionsFilterDto filter, int page, int pageSize) throws AppException;
    public void submitCategory(CategoryDto category) throws AppException;
    public void removeCategory(Long categoryId) throws AppException;
    public void submitCurrency(CurrencyDto currency) throws AppException;
    public void removeCurrency(Long currencyId) throws AppException;
    public void submitBook(BookDto book) throws AppException;
    public void removeBook(Long bookId) throws AppException;
    public void submitAccount(AccountDto account) throws AppException;
    public void removeAccount(Long accountId) throws AppException;
    public void submitTransaction(TransactionDto transaction) throws AppException;
    public void detachTransaction(TransactionDto transaction, Long originalId) throws AppException;
    public void removeTransaction(Long transactionId) throws AppException;
    public void submitTag(TagDto tag) throws AppException;
    public void removeTag(Long tagId) throws AppException;
    public UserDto authenticate(String login, String password) throws AppException;
    public void logout() throws AppException;
    public List<Map<Long, Double[]>> getBalanceArchive(Long bookId, Date dateFrom, Date dateTo, boolean approvedOnly) throws AppException;
}
